home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Language/OS - Multiplatform Resource Library
/
LANGUAGE OS.iso
/
cpp_libs
/
oath.lha
/
oath
/
test
/
chars2b.cc
< prev
next >
Wrap
C/C++ Source or Header
|
1991-08-29
|
2KB
|
65 lines
#include "oath/character.h"
#include <fstream.h>
/////////////////////////////////////////////////////////////////////////////
// Test of characters and tokens
main ()
{// Retrieve characters /////////
ifstream File ("chars2.obj");
characterA A = characterA::isa(objA::import(File));
characterA B = characterA::isa(objA::import(File));
characterA C = characterA::isa(objA::import(File));
characterA D = characterA::isa(objA::import(File));
cout << A << B << C << D << endl;
// Test character functionality /////////
if(A == B || B == C || C == D || D == A)
cout << "== failed!" << endl;
else
cout << "== succeeded!" << endl;
if(A.is(B) || B.is(C) || C.is(D) || D.is(A))
cout << "is() failed!" << endl;
else
cout << "is() succeeded!" << endl;
if(!A || !B || !C || !D)
cout << "! failed!" << endl;
else
cout << "! succeeded!" << endl;
// Part Two ////////////////////
characterA AC = A;
characterA BC = B;
characterA CC = C;
characterA DC = D;
cout << AC << BC << CC << DC << endl;
if(A == AC && B == BC && C == CC && D == DC)
cout << "== succeeded!" << endl;
else
cout << "== failed!" << endl;
if(A.is(AC) && B.is(BC) && C.is(CC) && D.is(DC))
cout << "is() succeeded!" << endl;
else
cout << "is() failed!" << endl;
if(!AC || !BC || !CC || !DC)
cout << "! failed!" << endl;
else
cout << "! succeeded!" << endl;
}